<template>
	<view>
		<u-navbar class="custom-header" back-text="返回" title="转移单" height="44" >
			<view slot="right">
			 <u-button type="primary" size="mini"  style="margin-right: 20rpx;" @click="handleSave">保存</u-button>
			</view>
		</u-navbar>
	<view class="text">转移单基本信息</view>
	<uni-card>
	<u-form
			labelPosition="left"
			:model="model"
			ref="uForm"
			label-width="200rpx"
	>
		<u-form-item
				label="转移单号:"
				prop="danhao"
				borderBottom
		>
			<u-input
					v-model="model.danhao"
					placeholder="保存后系统自动生成"
					:border="border"
			></u-input>
		</u-form-item>
		<u-form-item
				label="转移单名称:"
				prop="mingchen"
				borderBottom
		>
			<u-input
					v-model="model.mingchen"
					placeholder="请输入转移单名称"
					:border="border"
			></u-input>
		</u-form-item>
		<u-form-item
				label="转移类型:"
				prop="mingchen"
				borderBottom
		>
			<u-radio-group v-model="value" @change="radioGroupChange">
						<u-radio 
							@change="radioChange" 
							v-for="(item, index) in listType" :key="index" 
							:name="item.name"
							:disabled="item.disabled"
						>
							{{item.name}}
						</u-radio>
					</u-radio-group>
		</u-form-item>
		<u-form-item
				label="转出仓库:"
				prop="mingchen"
				borderBottom
		>
			<u-input
					v-model="model.mingchen"
					placeholder=""
					:border="border"
			></u-input>
		</u-form-item>
		<u-form-item
				label="转入仓库:"
				prop="mingchen"
				borderBottom
		>
			<u-input
					v-model="model.mingchen"
					placeholder=""
					:border="border"
			></u-input>
		</u-form-item>
		<u-form-item
				label="转移日期:"
				prop="time"
				borderBottom
		>
			<u-input
					v-model="model.time"
					placeholder="请选择日期"
					:border="border"
					type="select"
					@click="show2 = true"
			></u-input>
			<u-picker v-model="show2" mode="time" :params="params" @confirm="confirm2"></u-picker>
		</u-form-item>
	</u-form>
	</uni-card>
	<u-gap height="20" bg-color="#dedede"></u-gap>
	<view class="text">转移单明细信息</view>
	<u-row gutter="32" justify="center">
		<u-col span="10">
			<view><u-button type="success"  @click="navTo('/pages/sys/home/components/work_bench/sale_back_add')">新增</u-button></view>
		</u-col>
	</u-row>
	<uni-list>
		<uni-list-item  v-for="(workReport,index) in workList" :key="index">
			<template slot="body">
				<uni-card is-full class="uni-list-card" padding="0" spacing="0" >
					<view class="list-item-content">
						<view class="list-item-body">
							<view class="item-label">产品：</view>
							<view class="u-line-1 item-value">{{workReport.itemName}}</view>
						</view>
						<view class="list-item-body">
							<view class="item-label">在库数量：</view>
							<view class="u-line-1 item-value">{{workReport.quantityQualified}}</view>
						</view>
						<view class="list-item-body">
							<view class="item-label">安全库存：</view>
							<view class="u-line-1 item-value">{{workReport.quantityUnquanlified}}</view>
						</view>
						<view class="list-item-body">
							<view class="item-label">所在位置：</view>
							<view class="u-line-1 item-value">{{workReport.createTime}}</view>
						</view>
					</view>
				</uni-card>
			</template>
		</uni-list-item>
	 </uni-list>
	<u-row gutter="32" class="bottom-box" justify="center">
		<u-col span="10">
			<view><u-button type="primary" shape="circle" @click="navTo('/pages/sys/home/index')">提交</u-button></view>
		</u-col>
	</u-row>
	</view>
</template>

<script>
	export default {
		data() {
			return {
           model: {
              danhao:'',
			  mingchen:'',
			  gys:'',
			  cgdh:'',
			  jcdh:'',
			  time:'',
           },
           border:false,
		   show1: false,
		   show2:false,
		   list: [
		   					{
		   						value: '1',
		   						label: '华为'
		   					},
		   					{
		   						value: '2',
		   						label: '苹果'
		   					}
		   				],
			params: {
								year: true,
								month: true,
								day: true,
							},
			workList:[{itemName:1,quantityQualified:2,quantityUnquanlified:3,createTime:4}],
			listType:[
				{
									name: '内部转移',
									disabled: false
								},
								{
									name: '外部转移',
									disabled: false
								},
			],
			value: 'orange',
			}
		},
		methods: {
			handleSave(){
				
			},
			confirm1(e){
				console.log(e);
				this.model.gys=e[0].label
			},
			confirm2(e){
				console.log(e);
			},
			navTo(url) {
				console.log(111);
				uni.navigateTo({
					url: url
				});
			},
			radioGroupChange(e){
				console.log(e);
			},
			radioChange(e){
				console.log(e);
			}
		}
	}
</script>

<style scoped lang="scss">
.text{
	font-weight:bold;
	text-align:center;
	margin: 20rpx 0;
}
</style>
